fredvs
My posts
Account settings
Log out

Playing only the beginning of a recording

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Playing only the beginning of a recording

Sc0li0sis
3 posts
Can I play only a specific number of seconds/minutes of an MP3 file?

Best regards,
Sc0li0sis
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Playing only the beginning of a recording

fredvs
Administrator
718 posts
This post was updated on Sep 28, 2025; 10:29pm.
Hello Sc0li0sis and welcome to the uos forum.

You may do it via the uos_LoopProcIn() procedure.

If you take the uos SimplePlayer demo:

First add your stoptime, at line 125:

var
stoptime:  ttime;

then define it, adding at line 499 ( to stop after 1 second 500 ms )
stoptime := EncodeTime(00,00,01,500);

Finally update the uos_LoopProcIn() // procedure LoopProcPlayer1:
add this at line 710:
if uos_InputPositionTime(PlayerIndex1, Inputindex1) >= stoptime then uos_Stop(PlayerIndex1);

This will stop the player at stoptime.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Playing only the beginning of a recording

fredvs
Administrator
718 posts
Ooops, for the uos demo  SimplePlayer the stop time is a bit too big ( the demo songs are < 1 sec 500 ) so
better to use something like stoptime := EncodeTime(00,00,01,50); to test.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Playing only the beginning of a recording

Sc0li0sis
3 posts
Thank you so much for your quick response. I'll test it when I get home.

Fredvs, you're amazing.

Sc0li0sis
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Playing only the beginning of a recording

Sc0li0sis
3 posts
It worked,
Thanks a lot again.

Sc0li0sis
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Playing only the beginning of a recording

fredvs
Administrator
718 posts
Nice!  
You are welcome.
Fre;D